
** Setting the working directory **
*cd "<ADD DIRECTORY>"

* Loading the dataset (.dta)
use Arms_dataset.dta, clear


****************************
** Descriptive statistics **
****************************
sum age
tab gender
tab ideology


*********************
*** Main analyses ***
*********************

* The main DV
sum oppose_sale_01

** Manipulation checks **
tab correct_mc1
tab correct_mc2


*** Basic test of the Experimental effect on the DV ***

** Graph #1 **
* ssc install cibar
cibar oppose_01 , over1(HR_exp) level(95) barcol(gs14 gs6) barlabel(on) blf(%9.0f) blposition(10)  graphopts(ylabel(,) graphregion(color(white)) ytitle("Opposition to the arms sale (%)")) 
tab oppose_01 HR_exp, chi col
** Graph #2 **
cibar oppose_01, over1(HR_exp) over2(ties_exp) over3(cyber_exp) level(95) barcol(gs14 gs6) barlabel(on) blf(%9.0f) blposition(11)  graphopts(ylabel(,) graphregion(color(white)) ytitle("Opposition to the arms sale (%)"))
tab oppose_01 HR_exp if ties_exp==0 & cyber_exp==0, chi col
tab oppose_01 HR_exp if ties_exp==0 & cyber_exp==1, chi col
tab oppose_01 HR_exp if ties_exp==1 & cyber_exp==0, chi col
tab oppose_01 HR_exp if ties_exp==1 & cyber_exp==1, chi col
tab oppose_01 HR_exp if ties_exp==2 & cyber_exp==0, chi col
tab oppose_01 HR_exp if ties_exp==2 & cyber_exp==1, chi col

tab oppose_01 ties_exp, chi col
tab oppose_01 cyber_exp, chi col


**  Figure 3 **
cibar oppose_01 if HR_exp==1, over1(ties_exp) level(95) barcol(black gs14 gs6) barlabel(on) blf(%9.0f) blposition(11)  graphopts(ylabel(,) graphregion(color(white)) ytitle("Opposition to the arms sale (%)")) 

tab oppose_01 ties_exp if HR_exp==0, chi col
tab oppose_01 ties_exp if HR_exp==0 & ties!=1, chi col
tab oppose_01 ties_exp if HR_exp==0 & ties!=2, chi col
tab oppose_01 ties_exp if HR_exp==1, chi col
tab oppose_01 ties_exp if HR_exp==1 & ties!=1, chi col
tab oppose_01 ties_exp if HR_exp==1 & ties!=2, chi col

** Figure 4 **
cibar oppose_01 if HR_exp==1, over1(cyber_exp) level(95) barcol(black gs14) barlabel(on) blf(%9.0f) blposition(11)  graphopts(ylabel(,) graphregion(color(white)) ytitle("Opposition to the arms sale (%)"))

tab oppose_01 cyber_exp if HR_exp==0, chi col
tab oppose_01 cyber_exp if HR_exp==1, chi col



*************************
** Regression analyses **
*************************
** Table 1 **

* Model 1 - Bare-bones model
reg oppose_sale_01 i.HR_exp i.ties_exp i.cyber_exp, r
outreg2 using Table_1.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 2 - With individual-level variables as control variables
reg oppose_sale_01 i.HR_exp i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity ideology , r
outreg2 using Table_1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 
margins i.HR_exp, atmeans
*ologit oppose_sale i.HR_exp i.ties_exp i.cyber_exp if oppose_sale!=6 , r


* Figure 5
quietly reg oppose_sale_01  i.HR_exp i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity ideology , r
coefplot, drop(_cons) xline(0) level(90) graphregion(color(white)) ytitle("") ///
title("", size(medsmall)) ///
/*fxsize(90)*/ coeflabel(1.HR_exp = "HR violations" ///
				   1.ties_exp = "Economic ties" ///
			       2.ties_exp = "Security ties" ///
				   1.cyber_exp = "Cyber" ///
			       age = "Age" ///
			       gender = "Gender" ///
				   college_educ = "College" ///
			       jewish = "Jewish" ///
				   religiosity = "Religiosity" ///
				   ideology = "R-L ideology")
*graph save "Figure5.gph", replace




** Table 2 **

* Model 1 - The effect of the ties conditions among human rights violators
reg oppose_sale_01 i.ties_exp if HR_exp==1, r
outreg2 using Table_2.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 2 - With individual-level variables as control variables
reg oppose_sale_01 i.ties_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 , r
outreg2 using Table_2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)
*margins i.ties_exp, atmeans
*marginsplot

* Model 3 - The effect of the cyber arms sale among human rights violators
reg oppose_sale_01 i.cyber_exp if HR_exp==1, r
outreg2 using Table_2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 4 - With individual-level variables as control variables
reg oppose_sale_01 i.cyber_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 , r
outreg2 using Table_2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)
*margins i.cyber_exp, atmeans
*marginsplot




*************************************
** Analyses in the Onlile Appendix **
*************************************

****************************************
** Section A - Descriptive statistics **
****************************************
sum age
tab gender
tab jewish
tab religiosity
tab education 
tab ideology
tab college_educ



*******************************
** Section C - Balance tests **
*******************************

oneway age arms_conditions, t
tab arms_conditions gender, chi col
tab arms_conditions college_educ, chi col
tab arms_conditions jewish, chi col
oneway religiosity arms_conditions, t
oneway ideology arms_conditions, t

oneway age HR_exp, t
tab HR_exp gender, chi col
tab HR_exp college_educ, chi col
tab HR_exp jewish, chi col
oneway religiosity HR_exp, t
oneway ideology HR_exp, t

oneway age ties_exp, t 
tab ties_exp gender, chi col
tab ties_exp college_educ, chi col
tab ties_exp jewish, chi col
oneway religiosity ties_exp, t
oneway ideology ties_exp, t

oneway age cyber_exp, t /*significant*/
tab cyber_exp gender, chi col
tab cyber_exp college_educ, chi col
tab cyber_exp jewish, chi col
oneway religiosity cyber_exp, t
oneway ideology cyber_exp, t

mlogit arms_conditions age gender college_educ jewish religiosity ideology /*p=0.744*/ 
mlogit HR_exp age gender jewish college_educ religiosity ideology /*p=0.796*/ 
mlogit ties_exp age gender jewish college_educ religiosity ideology /*p=0.762*/ 
mlogit cyber_exp age gender jewish college_educ religiosity ideology /*p=0.370*/ 



**********************************
** Section D - Robustness tests **
**********************************

** Table D1 - Logistic regressions, binary DV (Opposition to Arms Sale) **
* Model 1 - Bare-bones model (Model 1 in Table 1)
logit oppose_01 i.HR_exp i.ties_exp i.cyber_exp, r
outreg2 using Table_D1.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 2 - With individual-level variables as control variables (Model 2 in Table 1)
logit oppose_01 i.HR_exp i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity ideology , r
outreg2 using Table_D1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 3 - The effect of the ties conditions among human rights violators (Model 1 in Table 2)
logit oppose_01 i.ties_exp if HR_exp==1, r
outreg2 using Table_D1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 4 - With individual-level variables as control variables (Model 2 in Table 1)
logit oppose_01 i.ties_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1, r
outreg2 using Table_D1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 5 - The effect of the cyber arms sale among human rights violators (Model 3 in Table 2)
logit oppose_01 i.cyber_exp if HR_exp==1, r
outreg2 using Table_D1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 6 - With individual-level variables as control variables (Model 4 in Table 2)
logit oppose_01 i.cyber_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1, r
outreg2 using Table_D1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)


** Table D2 - Ordered logistic regressions, ordinal DV (Opposition to Arms Sale) **
* Model 1 - Bare-bones model (Model 1 in Table 1)
ologit oppose_sale i.HR_exp i.ties_exp i.cyber_exp if oppose_sale!=6, r
outreg2 using Table_D2.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 2 - With individual-level variables as control variables (Model 2 in Table 1)
ologit oppose_sale i.HR_exp i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity ideology if oppose_sale!=6, r
outreg2 using Table_D2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 3 - The effect of the ties conditions among human rights violators (Model 1 in Table 2)
ologit oppose_sale i.ties_exp if HR_exp==1 & oppose_sale!=6, r
outreg2 using Table_D2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 4 - With individual-level variables as control variables (Model 2 in Table 1)
ologit oppose_sale i.ties_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 & oppose_sale!=6, r
outreg2 using Table_D2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 5 - The effect of the cyber arms sale among human rights violators (Model 3 in Table 2)
ologit oppose_sale i.cyber_exp if HR_exp==1 & oppose_sale!=6, r
outreg2 using Table_D2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 6 - With individual-level variables as control variables (Model 4 in Table 2)
ologit oppose_sale i.cyber_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 & oppose_sale!=6, r
outreg2 using Table_D2.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)


** Table D3 - Similar to Table 1, but with "Don't know" responses as mid-category (3)
gen oppose_sale_01_DK=oppose_sale_01
replace oppose_sale_01_DK=0.5 if oppose_sale==6
sum oppose_sale_01 oppose_sale_01_DK

* Model 1 - Bare-bones model (Model 1 in Table 1)
reg oppose_sale_01_DK i.HR_exp i.ties_exp i.cyber_exp, r
outreg2 using Table_D3.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 2 - With individual-level variables as control variables (Model 2 in Table 1)
reg oppose_sale_01_DK i.HR_exp i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity ideology , r
outreg2 using Table_D3.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 3 - The effect of the ties conditions among human rights violators (Model 1 in Table 2)
reg oppose_sale_01_DK i.ties_exp if HR_exp==1, r
outreg2 using Table_D3.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 4 - With individual-level variables as control variables (Model 2 in Table 1)
reg oppose_sale_01_DK i.ties_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1, r
outreg2 using Table_D3.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 5 - The effect of the cyber arms sale among human rights violators (Model 3 in Table 2)
reg oppose_sale_01_DK i.cyber_exp if HR_exp==1, r
outreg2 using Table_D3.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 6 - With individual-level variables as control variables (Model 4 in Table 2)
reg oppose_sale_01_DK i.cyber_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1, r
outreg2 using Table_D3.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

drop oppose_sale_01_DK


** Table D4 - Similar to Tables 1 & 2, but with omitting those who failed the first manipulation check
* Model 1 - Bare-bones model
reg oppose_sale_01 i.HR_exp i.ties_exp i.cyber_exp if correct_mc1==1, r
outreg2 using Table_D4.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 2 - With individual-level variables as control variables
reg oppose_sale_01 i.HR_exp i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity ideology if correct_mc1==1 , r
outreg2 using Table_D4.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 3 - The effect of the ties conditions among human rights violators
reg oppose_sale_01 i.ties_exp if HR_exp==1 & correct_mc1==1, r
outreg2 using Table_D4.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 4 - With individual-level variables as control variables
reg oppose_sale_01 i.ties_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 & correct_mc1==1, r
outreg2 using Table_D4.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 5 - The effect of the cyber arms sale among human rights violators
reg oppose_sale_01 i.cyber_exp if HR_exp==1 & correct_mc1==1, r
outreg2 using Table_D4.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 6 - With individual-level variables as control variables
reg oppose_sale_01 i.cyber_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 & correct_mc1==1, r
outreg2 using Table_D4.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)


** Table D5 - Similar to Tables 1 & 2, but with omitting those who failed the second manipulation check
* Model 1 - Bare-bones model
reg oppose_sale_01 i.HR_exp i.ties_exp i.cyber_exp if correct_mc2==1, r
outreg2 using Table_D5.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 2 - With individual-level variables as control variables
reg oppose_sale_01 i.HR_exp i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity ideology if correct_mc2==1 , r
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *) 

* Model 3 - The effect of the ties conditions among human rights violators
reg oppose_sale_01 i.ties_exp if HR_exp==1 & correct_mc2==1, r
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 4 - With individual-level variables as control variables
reg oppose_sale_01 i.ties_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 & correct_mc2==1, r
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 5 - The effect of the cyber arms sale among human rights violators
reg oppose_sale_01 i.cyber_exp if HR_exp==1 & correct_mc2==1, r
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* Model 6 - With individual-level variables as control variables
reg oppose_sale_01 i.cyber_exp ///
age gender college_educ jewish religiosity ideology if HR_exp==1 & correct_mc2==1, r
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)


** Table D6 - Heterogeneous treatment effects, Human Rights Violations
** Replicating Model 2 in Table 1, each time with a different interaction b/w the 
** Human Rights Violations condition and a different individual-level control variables

* Model 1 - interaction with age
reg oppose_sale_01 i.HR_exp##c.age i.ties_exp i.cyber_exp ///
gender college_educ jewish religiosity ideology, r

* Model 2 - interaction with gender
reg oppose_sale_01 i.HR_exp##i.gender i.ties_exp i.cyber_exp ///
age college_educ jewish religiosity ideology, r

* Model 3 - interaction with college education
reg oppose_sale_01 i.HR_exp##i.college_educ i.ties_exp i.cyber_exp ///
age gender jewish religiosity ideology, r

* Model 4 - interaction with Jewish respondent
reg oppose_sale_01 i.HR_exp##i.jewish i.ties_exp i.cyber_exp ///
age gender college_educ religiosity ideology, r

* Model 5 - interaction with religiosity
reg oppose_sale_01 i.HR_exp##c.religiosity i.ties_exp i.cyber_exp ///
age gender college_educ jewish ideology, r

* Model 6 - interaction with ideological groups
recode ideology (1/3=1) (4=2) (5/7=3), gen (ideo_group)
label define ideo_group_lab 1 "Right" 2 "Center" 3 "Left"
label values ideo_group ideo_group_lab
tab ideology ideo_group
reg oppose_sale_01 i.HR_exp##i.ideo_group i.ties_exp i.cyber_exp ///
age gender college_educ jewish religiosity, r
drop ideo_group
** The different interaction estimates from the six models are shown in Table D6 **



***************************
** Section E - Mechanisms **
****************************
** Basic analyses - similar to Kreps and Wallace 2016 (JPR) **

* 1st potential mechanism: Israel has a moral obligation to insure the weapons it sells
* will not be used to harm innocent people
reg israel_moral_obligation_01 i.HR_exp i.ties_exp i.cyber_exp if oppose_sale!=6, r
outreg2 using Table_E1.doc, replace se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* 2nd potential mechanism: Israel selling weapons can lead to international critique of Israel
reg israel_intl_critique_01 i.HR_exp i.ties_exp i.cyber_exp if oppose_sale!=6, r
outreg2 using Table_E1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* 3rd potential mechanism: Selling weapons is important to the Israeli economy
reg israel_weapons_economy_01 i.HR_exp i.ties_exp i.cyber_exp if oppose_sale!=6, r
outreg2 using Table_E1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* 4th potential mechanism: If Israel won't sell weapons to certain countries, others will
reg israel_weapons_others_01 i.HR_exp i.ties_exp i.cyber_exp if oppose_sale!=6, r
outreg2 using Table_E1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)

* 5th potential mechanism: Israel needs to go everything to garner good relations with other countries
reg israel_others_relations_01 i.HR_exp i.ties_exp i.cyber_exp if oppose_sale!=6, r
outreg2 using Table_E1.doc, append se dec(2) alpha (.01, .05, .1) ///
symbol (***, **, *)



*** Causal Mechanisms Analyses ***
drop if oppose_sale==6

* 1st potential mechanism: Israel has a moral obligation to insure the weapons it sells
* will not be used to harm innocent people
medeff(regress israel_moral_obligation_01 HR_exp) ///
(regress oppose_sale_01 israel_moral_obligation_01 HR_exp), ///
mediate(israel_moral_obligation_01) treat(HR_exp) sims(1604)

* 2nd potential mechanism: Israel selling weapons can lead to international critique of Israel
medeff(regress israel_intl_critique_01 HR_exp) ///
(regress oppose_sale_01 israel_intl_critique_01 HR_exp), ///
mediate(israel_intl_critique_01) treat(HR_exp) sims(1584)

* 3rd potential mechanism: Selling weapons is important to the Israeli economy
medeff(regress israel_weapons_economy_01 HR_exp) ///
(regress oppose_sale_01 israel_weapons_economy_01 HR_exp), ///
mediate(israel_weapons_economy_01) treat(HR_exp) sims(1569)

* 4th potential mechanism: If Israel won't sell weapons to certain countries, others will
medeff(regress israel_weapons_others_01 HR_exp) ///
(regress oppose_sale_01 israel_weapons_others_01 HR_exp), ///
mediate(israel_weapons_others_01) treat(HR_exp) sims(1553)

* 5th potential mechanism: Israel needs to go everything to garner good relations with other countries
medeff(regress israel_others_relations_01 HR_exp) ///
(regress oppose_sale_01 israel_others_relations_01 HR_exp), ///
mediate(israel_others_relations_01) treat(HR_exp) sims(1621)
